require(['./config'],()=>{
   require(['bootstrap','cookie','jquery','footer'],()=>{
      class Register{
         constructor(){
            this.init()
            // this.Get()
         }
         init(){
            this.$username=$('#exampleInputEmail1')
            this.$password=$('#exampleInputPassword1')
            $('#btn').on('click',()=>{
               var username=this.$username.val(),
                   password=this.$password.val();
              var  userInfo={username,password}
              var  userList=localStorage.getItem('userList')
              if(userList){
                 userList=JSON.parse(userList)
                 userList.push(userInfo)
                 localStorage.setItem('userList',JSON.stringify(userList))
              }else{
                 var  arr=[userInfo]
                 localStorage.setItem('userList',JSON.stringify(arr))
              }
              alert('注册成功，即将跳转至登录界面')
              window.location.href='/html/login.html'
            })
         }
         Get(){
            this.$user=$('#exampleInputEmail1')
            $('#btn1').on('click',()=>{
               var username=this.$user.val()
               console.log(username)
            })
         }
         
      }
      new Register()
   })
})